package com.dragon.modules.yuegou.query.wallet;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.wallet.CardPresentEntity;
import com.dragon.modules.yuegou.enums.wallet.CardPresentType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 悦卡赠送 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-06-03 15:20:35
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class CardPresentQuery extends CardPresentEntity implements Query<CardPresentEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 赠送ID查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 悦卡模板ID查询条件 */
	@JsonUnwrapped(prefix = "cardTemplateId")
	private Condition<String> cardTemplateIdCondition;

    /** 赠送数量查询条件 */
	@JsonUnwrapped(prefix = "num")
	private Condition<Integer> numCondition;

    /** 已提取数量查询条件 */
	@JsonUnwrapped(prefix = "extractedNum")
	private Condition<Integer> extractedNumCondition;

    /** [枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<CardPresentType> typeCondition;

    /** 提取时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public CardPresentQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public CardPresentQuery(CardPresentEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public CardPresentQuery(CardPresentQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if(other.cardTemplateIdCondition != null) {
			this.cardTemplateIdCondition = other.cardTemplateIdCondition.copy();
		}
		if(other.numCondition != null) {
			this.numCondition = other.numCondition.copy();
		}
		if(other.extractedNumCondition != null) {
			this.extractedNumCondition = other.extractedNumCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<CardPresentEntity> toQueryWrapper() {
		QueryWrapper<CardPresentEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (numCondition != null) {
			numCondition.toWrapper(wrapper, COL_NUM);
		}
		if (extractedNumCondition != null) {
			extractedNumCondition.toWrapper(wrapper, COL_EXTRACTED_NUM);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回赠送ID查询条件
	 * 
	 * @return memberIdCondition 赠送ID查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取赠送ID查询条件
	 * 
	 * @return memberIdCondition 赠送ID查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置赠送ID查询条件
	 * 
	 * @param memberIdCondition 赠送ID查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回悦卡模板ID查询条件
	 * 
	 * @return cardTemplateIdCondition 悦卡模板ID查询条件
	 */
	public Condition<String> cardTemplateId() {
		this.cardTemplateIdCondition = new Condition<>();
		return this.cardTemplateIdCondition;
	}
	
	/**
	 * 获取悦卡模板ID查询条件
	 * 
	 * @return cardTemplateIdCondition 悦卡模板ID查询条件
	 */
	public Condition<String> getCardTemplateIdCondition() {
		return cardTemplateIdCondition;
	}

	/**
	 * 设置悦卡模板ID查询条件
	 * 
	 * @param cardTemplateIdCondition 悦卡模板ID查询条件
	 */
	public void setCardTemplateIdCondition(Condition<String> cardTemplateIdCondition) {
		this.cardTemplateIdCondition = cardTemplateIdCondition;
	}

	/**
	 * 构造并返回赠送数量查询条件
	 * 
	 * @return numCondition 赠送数量查询条件
	 */
	public Condition<Integer> num() {
		this.numCondition = new Condition<>();
		return this.numCondition;
	}
	
	/**
	 * 获取赠送数量查询条件
	 * 
	 * @return numCondition 赠送数量查询条件
	 */
	public Condition<Integer> getNumCondition() {
		return numCondition;
	}

	/**
	 * 设置赠送数量查询条件
	 * 
	 * @param numCondition 赠送数量查询条件
	 */
	public void setNumCondition(Condition<Integer> numCondition) {
		this.numCondition = numCondition;
	}

	/**
	 * 构造并返回已提取数量查询条件
	 * 
	 * @return extractedNumCondition 已提取数量查询条件
	 */
	public Condition<Integer> extractedNum() {
		this.extractedNumCondition = new Condition<>();
		return this.extractedNumCondition;
	}
	
	/**
	 * 获取已提取数量查询条件
	 * 
	 * @return extractedNumCondition 已提取数量查询条件
	 */
	public Condition<Integer> getExtractedNumCondition() {
		return extractedNumCondition;
	}

	/**
	 * 设置已提取数量查询条件
	 * 
	 * @param extractedNumCondition 已提取数量查询条件
	 */
	public void setExtractedNumCondition(Condition<Integer> extractedNumCondition) {
		this.extractedNumCondition = extractedNumCondition;
	}

	/**
	 * 构造并返回[枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件
	 * 
	 * @return typeCondition [枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件
	 */
	public Condition<CardPresentType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}
	
	/**
	 * 获取[枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件
	 * 
	 * @return typeCondition [枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件
	 */
	public Condition<CardPresentType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件
	 * 
	 * @param typeCondition [枚举]赠送类型：0-赠送给好友-TO_FRIENDS、1-生成提取码-GENERATE_CODE查询条件
	 */
	public void setTypeCondition(Condition<CardPresentType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回提取时间查询条件
	 * 
	 * @return createdTimeCondition 提取时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取提取时间查询条件
	 * 
	 * @return createdTimeCondition 提取时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置提取时间查询条件
	 * 
	 * @param createdTimeCondition 提取时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

}
